package cn.edu.dgut.css.sai.springsecuritygiteeexperiment;


/**
 * @author: lzh
 */
public class StringSources {
    public static String sources(String s, String ...args) {
        if(s == null || args == null || args.length == 0) {
            return null;
        }
        for (String arg : args) {
            int begin = s.indexOf("{");
            int end = s.indexOf("}") + 1;
            if(begin >= 0 && end >= 0) {
                String substring = s.substring(begin, end);
                s = s.replace(substring, arg);
            } else {
                break;
            }
        }
        return s;
    }
}
